package com.aspose.cells;

abstract class zfc {
   static double[] a = new double[]{1.0D, 0.1D, 0.01D, 0.001D, 1.0E-4D, 1.0E-5D, 1.0E-6D, 1.0E-7D, 1.0E-8D, 1.0E-9D, 1.0E-10D, 1.0E-11D, 1.0E-12D, 1.0E-13D, 1.0E-14D, 1.0E-15D, 1.0E-16D, 1.0E-17D, 1.0E-18D, 1.0E-19D, 1.0E-20D, 1.0E-21D, 1.0E-22D, 1.0E-23D, 1.0E-24D, 1.0E-25D, 1.0E-26D, 1.0E-27D, 1.0E-28D, 1.0E-29D, 1.0E-30D};

   static boolean a(double var0, double var2) {
      if (var0 == var2) {
         return true;
      } else {
         double var4 = Math.abs(var0 - var2);
         if (var4 < Double.MIN_VALUE) {
            return true;
         } else {
            if (var4 < 1.0E-4D) {
               int var6 = (int)Math.log10(Math.abs(var0));
               int var7 = 14 - var6;
               if (var7 >= 0) {
                  if (var7 >= a.length) {
                     return var4 < Math.pow(10.0D, (double)(-var7));
                  }

                  return var4 < a[var7];
               }
            }

            return false;
         }
      }
   }

   static boolean a(double var0) {
      double var2 = Math.abs(var0);
      if (var2 < Double.MIN_VALUE) {
         return true;
      } else {
         if (var2 < 1.0E-4D) {
            int var4 = (int)Math.log10(var2);
            int var5 = 14 - var4;
            if (var5 >= 0) {
               if (var5 >= a.length) {
                  return var2 < Math.pow(10.0D, (double)(-var5));
               }

               return var2 < a[var5];
            }
         }

         return false;
      }
   }

   static double b(double var0, double var2) {
      double var4 = var0 + var2;
      double var6 = Math.abs(var4);
      if (var6 < Double.MIN_VALUE) {
         return 0.0D;
      } else {
         if (var6 < 1.0E-4D) {
            int var8 = (int)Math.log10(Math.abs(var0));
            int var9 = 14 - var8;
            if (var9 >= 0) {
               if (var9 >= a.length) {
                  if (var6 < Math.pow(10.0D, (double)(-var9))) {
                     return 0.0D;
                  }
               } else if (var6 < a[var9]) {
                  return 0.0D;
               }
            }
         }

         return var4;
      }
   }

   static double c(double var0, double var2) {
      if (var2 < 0.0D) {
         return 1.0D / c(var0, -var2);
      } else {
         int var4 = (int)var2;
         return var2 != (double)var4 ? Math.pow(var0, var2) : a(var0, var4);
      }
   }

   static double a(double var0, int var2) {
      if (var0 == 0.0D) {
         return 0.0D;
      } else if (var2 == 0) {
         return 1.0D;
      } else {
         double var3;
         int var6;
         for(var3 = 1.0D; var2 != 0; var2 = var6) {
            int var5 = var2 % 2;
            var6 = var2 / 2;
            if (var5 != 0) {
               var3 *= var0;
            }

            var0 *= var0;
         }

         return var3;
      }
   }

   static double b(double var0) {
      return var0 == 0.0D ? 0.0D : c(var0);
   }

   static double c(double var0) {
      double var2 = Math.pow(10.0D, (double)(14 - (int)Math.log10(Math.abs(var0))));
      return (double)com.aspose.cells.b.a.zq.a(var0 * var2) / var2;
   }
}
